//
//  WLMBaseTableViewController.swift
//  WeiBo
//
//  Created by Eric on 2017-01-05.
//  Copyright © 2017 Eric. All rights reserved.
//

import UIKit

class WLMBaseTableViewController: UITableViewController,WLMVisitorLoginViewDelegate {

    var userLogin = WLMUserAccountViewModel.shared.userLogin
    
    //声明属性
    lazy var visitorView : WLMVisitorLoginView = WLMVisitorLoginView()
    
    //创建视图层次结构,实例化根视图
    override func loadView() {
        if userLogin {
            super.loadView()
        }
        else {
            view = visitorView
            visitorView.delegate = self
        }
    }
    
    //实现协议方法
    func userWillLogin() {
        //加载首页页面
        let oauth = WLMOAuthViewController()
        let nav = UINavigationController(rootViewController: oauth)
        //modal
        present(nav, animated: true, completion: nil)

    }
    
    func userWillRegister() {
        
    }
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        
    }


}
